package cn.iocoder.yudao.module.reservation.dal.mysql.services;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.reservation.dal.dataobject.services.ServicesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.reservation.controller.admin.services.vo.*;

/**
 * 店铺服务 Mapper
 *
 * @author yy
 */
@Mapper
public interface ServicesMapper extends BaseMapperX<ServicesDO> {

    default PageResult<ServicesDO> selectPage(ServicesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ServicesDO>()
                .likeIfPresent(ServicesDO::getName, reqVO.getName())
                .eqIfPresent(ServicesDO::getCategory, reqVO.getCategory())
                .eqIfPresent(ServicesDO::getCycle, reqVO.getCycle())
                .eqIfPresent(ServicesDO::getStatus, reqVO.getStatus())
                .orderByDesc(ServicesDO::getId));
    }

}